Skip to content

feat(search): add Sofya as a search provider - #6715

Open
yusufgurdogan wants to merge 1 commit into
odysseus-dev:devfrom
yusufgurdogan:feat/sofya-search-provider
Open

yusufgurdogan wants to merge 1 commit into
odysseus-dev:devfrom
yusufgurdogan:feat/sofya-search-provider

Conversation

@yusufgurdogan

Copy link
Copy Markdown

Summary

Adds Sofya as an opt-in search provider next to Tavily and Serper, as proposed in #6431. It's one provider function in services/search/providers.py, one dispatch branch in core.py, the API key setting, and the provider in the Settings and Deep Research pickers. It requests Sofya's snippets depth because Odysseus fetches the pages it keeps itself, and it maps the day/week/month/year time filter to Sofya's freshness. SearXNG stays the default and nothing changes unless someone picks Sofya. Disclosure: I built Sofya.

Target branch

  • This PR targets the correct integration branch: lab in the private maintainer-preview repository, or dev in the public repository. main remains release-curated.

Linked Issue

Fixes #6431

Type of Change

  • Bug fix (non-breaking — fixes a confirmed issue)
  • New feature (non-breaking — adds new behaviour)
  • Breaking change (changes or removes existing behaviour)
  • Refactor / cleanup (behaviour unchanged)
  • Documentation only
  • CI / tooling / configuration

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets the correct integration branch (lab in maintainer-preview; dev in the public repository)
  • My changes are limited to the scope described above — no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app (docker compose up or uvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.
  • I did not run the app/runtime validation and stated that gap in How to Test. Leave this unchecked when the app-run box above is checked.

How to Test

  1. pytest tests/test_sofya_search_provider.py tests/test_search_provider_json.py tests/test_search_config_provider_key.py. These are mocked httpx tests with no network. They cover the request shape and result mapping, a missing key, the env key, null fields, 429 and network errors returning empty, 401/402/503 raising like Tavily and Serper so the caller retries and records the error, malformed JSON, dispatch, and saving and loading the key through /api/auth/settings.
  2. Run the app, open Settings > Search, pick Sofya, paste a key from https://sofya.co, then Save and Test.
  3. Ask a question that needs web search. The log shows POST https://sofya.co/v1/search ... 200 and the answer cites the fetched sources.

The full suite fails the same 174 tests on this branch as on a clean dev checkout here, all environmental (no node or bubblewrap on this host), and the 12 new tests pass. node --check and scripts/check_frontend.mjs pass.

Visual / UI changes — REQUIRED if you touched anything that renders

  • Screenshot or short clip of the change in the running app, attached below. Mobile screenshot too if the change affects mobile.
  • Style match: the change uses Odysseus's existing visual language.
  • No new component patterns. If a similar widget already exists in the app, extend it instead of writing a parallel one.
  • I am not an LLM agent submitting a bulk PR. If you are, please open an issue describing the problem first — bulk auto-generated PRs that don't match the project's visual style are closed on sight, even when the underlying fix is correct.

The only UI changes are a new option in the two existing provider pickers, a hint line, a key placeholder, and a monochrome SVG mark in searchProviderIcons.js. I used an agent to help write it, so I opened #6431 first as CONTRIBUTING asks.

Screenshots / clips

odysseus-sofya-settings

@github-actions github-actions Bot added the ready for review Description complete — ready for maintainer review label Oct 14, 2026
@yusufgurdogan
yusufgurdogan force-pushed the feat/sofya-search-provider branch from 04332f4 to 6a40cd8 Compare November 15, 2026 10:49
Opt-in provider beside Tavily and Serper. Requests the snippets depth,
since Odysseus fetches the pages it keeps itself, and maps the
day/week/month/year time filter to Sofya's freshness. Key from Settings
or SOFYA_API_KEY.

Fixes odysseus-dev#6431
@yusufgurdogan
yusufgurdogan force-pushed the feat/sofya-search-provider branch from 6a40cd8 to 8098f58 Compare November 30, 2026 20:34
@yusufgurdogan yusufgurdogan mentioned this pull request Nov 30, 2026
3 tasks done

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Sofya as a search provider

1 participant